package com.ctshk.common.enums;

public enum StatusCode {

    NO_SUBMIT(0, "未提交"),
    REVIEW(1, "审批中"),
    REVIEW_NO(2, "审批不通过"),
    SUSPEND(3, "暂停"),
    INVALID(4, "无效"),
    EFFECTIVE(5, "有效"),
    WAIT_REVIEW(6, "待审批"),
    REVIEW_YES(7, "审批通过");


    private Integer code;
    private String msg;

    StatusCode(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public static String parseValue(int code) {
        for (StatusCode type : StatusCode.values()) {
            if (type.code == code) {
                return type.getMsg();
            }
        }
        return null;
    }
}
